package com.example.testing.ipcdemo.BindersService;

import android.os.RemoteException;

import com.example.testing.ipcdemo.ISecurityCenter;

/**
 * Created by tangjiangxu on 9/18/17.
 */

public class SecutityCenterImpl extends ISecurityCenter.Stub {
    private static final char SECRET_CODE = '^';

    @Override
    public String encrypt(String content) throws RemoteException {
        char[] chars = content.toCharArray();
        for (int i = 0; i < chars.length; i ++) {
            chars[i] ^= SECRET_CODE;
        }
        return new String(chars);
    }

    @Override
    public String decrypt(String password) throws RemoteException {
        return encrypt(password);
    }
}